<?php
@session_start();
$PurviewLevel=2;
$CheckChannelID=0;  
$PurviewLevel_Others="sys_vpp_indexad";

require("../../inc/common.inc.php");
require_once("../Admin_ChkPurview.php");
global $OTHERLINK;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<TITLE>铭讯EOS网站后台管理</TITLE>
<Meta name="Keywords" Content="济南网站建设 济南网站制作 山东网站建设 济南铭讯软件有限公司">
<Meta name="Description" Content="济南网站制作：铭讯软件专业服务优秀企业，致力于网站建、设网站推广、网络营销一体的全访位网络服务商">
<link rel="stylesheet" href="../images/style.css" type="text/css">
</head>
<body> 
<?php
if($actions=="up")
{
	$id=intval($id);
	if ($id==0){
		$fun->popmassage("请选择要修改的信息","","popback");
		exit();
	}
	$thisinfo=$db->getinfo("select * from mx_weixin_config where id='$id' limit 1");
	if (!is_array($thisinfo)){
		$fun->popmassage("没有要修改的信息","","popback");
		exit();
	}
	$orderid2=$thisinfo["orderid"];
	$otherinfo=$db->getinfo("select * from mx_weixin_config where orderid<'$thisinfo[orderid]' and orderid<>'0' order by orderid desc,id desc limit 1");
	if (!is_array($otherinfo)){
		$fun->popmassage("已经是第一个选项","","popback");
		exit();
	}
	$orderid=$otherinfo["orderid"];
	
	$db->excu("UPDATE mx_weixin_config SET orderid='$orderid' WHERE id='$thisinfo[id]'");
	$db->excu("UPDATE mx_weixin_config SET orderid='$orderid2' WHERE id='$otherinfo[id]'");
	jump2("修改成功","$FROMURL",0);
	exit();
}
elseif($actions=="down")
{
	$id=intval($id);
	if ($id==0){
		$fun->popmassage("请选择要修改的信息","","popback");
		exit();
	}
	$thisinfo=$db->getinfo("select * from mx_weixin_config where id='$id' limit 1");
	if (!is_array($thisinfo)){
		$fun->popmassage("没有要修改的信息","","popback");
		exit();
	}
	if ($thisinfo["orderid"]==0){
		$fun->popmassage("欢迎词排序不能修改","","popback");
		exit();
	}
	$orderid2=$thisinfo["orderid"];
	$otherinfo=$db->getinfo("select * from mx_weixin_config where orderid>'$thisinfo[orderid]' order by orderid asc,id asc limit 1");
	if (!is_array($otherinfo)){
		$fun->popmassage("已经是最后一个选项","","popback");
		exit();
	}
	$orderid=$otherinfo["orderid"];
	
	$db->excu("UPDATE mx_weixin_config SET orderid='$orderid' WHERE id='$thisinfo[id]'");
	$db->excu("UPDATE mx_weixin_config SET orderid='$orderid2' WHERE id='$otherinfo[id]'");
	jump2("修改成功","$FROMURL",0);
	exit();
}
elseif($actions=="yz")
{
	$ifyz=intval($ifyz);
	$db->excu("UPDATE mx_weixin_config SET isok='$ifyz',modidate='".date("Y-m-d H:i:s")."',modiid='".$_SESSION['mxadmin']['userid']."' WHERE id='$id'");
	jump2("修改成功","$FROMURL",0);
	exit();
}
?>
<?php require("../mx_head.php");?>
<div class="right">
<div class="xm2">
<h1 class="fl">初始步骤</h1>
</div>
<div class="xm2_b" style="border-bottom:0px;">
<div class="t">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
	<td>
	<div class="an1"><a href="yx_weixin_config.php">所有信息</a></div>
	<div class="an2"><a href="yx_weixin_config.php?isok=1">填写</a></div>
	<div class="an2"><a href="yx_weixin_config.php?isok=0">不填写</a></div>
	</td>
	</tr>
	</table>
</div>
</div>
<div class="xm2_b">
<div class="height10"></div>

<table width='100%' cellspacing='1' cellpadding='10' class="table_southidc">
    <tr class="head"> 
      <th width="10%" align="center">步骤</th>
      <th width="10%" align="center">标题</th>
      <th width="48%" align="center">提示详细</th>
      <th width="10%" align="center">排序</th>
      <th width="8%" align="center">状态</th>
      <th width="10%" align="center">操作</th>
    </tr>
	<?php
	$str="";
	if ($isok!=""){
		$isok=intval($isok);
		$str.=" and isok='$isok' ";
	}
	$rs=$db->excu("select * from mx_weixin_config where id>0 $str order by orderid asc,id asc");
	if ($db->num_rows($rs)>0){
	$i=0;
	while ($rsdb=$db->fetch_array($rs)){
		$i++;
		$rsdb[isok]=$rsdb[isok]?"<A HREF='?actions=yz&ifyz=0&id=".$rsdb[id]."' style='color:red;' title='取消启用'>启用</A>":"<A HREF='?actions=yz&ifyz=1&id=".$rsdb[id]."' style='color:blue;' title='设为启用'>未启用</A>";
	?>
    <tr class="list" align="center"> 
      <td>第<?php echo $i;?>步</td>
      <td><?php echo $rsdb["title"]?></td>
      <td align="left"><?php echo $rsdb['content']?></td>
	  <td><a href="yx_weixin_config.php?actions=up&id=<?php echo $rsdb["id"];?>">↑</a>&nbsp;&nbsp;<a href="yx_weixin_config.php?actions=down&id=<?php echo $rsdb["id"];?>">↓</a></td>
      <td><?php echo $rsdb[isok]?></td>
      <td><a href="javascript:weixin_config_modi('修改<?php echo $rsdb["title"]?>','<?php echo $rsdb[id]?>')">修改</a></td>
    </tr>
	<?php
	}
	}
	?>
	</table>
    <div class="height10"></div>
	<table width='100%' cellspacing='1' cellpadding='10' class="table_southidc">
    <tr class="list" align="center"> 
    <td>温馨提示：为了提供更好的体验度，建议选择1-2项必要信息操作。避免客户体验度降低，导致客户未能浏览微平台放弃操作。
</td>
    </tr>
    </table>
	<div class="clear"></div>
	<div class="height10"></div>
</div>
<script type="text/javascript" src="/mxsoft/js/jquerys-1.5.1.js"></script>
<script language="javascript">
$(document).ready(function(){  
	$(".table_southidc tr").mouseover(function(){   
	$(this).addClass("list2");}).mouseout(function(){   
	$(this).removeClass("list2");}) //移除该行的class   
	$(".table_southidc tr:even").addClass("list1");   
});
function weixin_config_modi(title,id){
    J.dialog.get({ id: 'test2', title:title,width: 435,height: 230, page: '/mxsoft/yingxiao/yx_weixin_config_modi.php?id='+id, cover: true });
}
</script> 

<div class="clear"></div>
<div class="height10"></div>
</div>
<?php require("../mx_foot.php");?>
<div class="clear"></div>
<div class="height10"></div>
<script language="javascript">
function check(){
//  if (document.form1.fid.value==""){
//    alert('请选择所属位置！');
//	document.form1.fid.focus();
//	return false;
//  }
  if (document.form1.postdb[name].value==""){
    alert('链接名称不能为空！');
	document.form1.postdb[name].focus();
	return false;
  }
  if (document.form1.postdb[url].value==""){
    alert('链接地址不能为空！');
	document.form1.postdb[url].focus();
	return false;
  }
  
}
</script>

</body>
</html>
